package com.cykj.admin.controller;

import com.cykj.admin.annotation.MyLog;
import com.cykj.admin.service.IDictService;
import com.cykj.admin.vo.DictVO;
import com.cykj.common.dto.ResponseDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @BelongsProject: smart_recruit_backend
 * @BelongsPackage: com.cykj.admin.controller
 * @Author: 小小卢
 * @CreateTime: 2025-08-28 14:04
 * @Description: TODO
 * @Version: 1.0
 */
@Tag(name = "DictController",description = "平台端字典管理的接口")
@RestController
@RequestMapping("dict")
public class DictController {
    @Autowired
    private IDictService dictService;

    /**
     * @Description: 查询所有字典类型
     * @Param: [dictVO]
     * @return: com.cykj.common.dto.ResponseDTO
     */
    @Operation(summary = "平台端查询所有字典类型信息接口")
    @GetMapping("getAllType")
    public ResponseDTO getAllDictTypeList() {
        return dictService.getAllDictTypeList();
    }

    /**
    * @Description: 条件查询字典类型
    * @Param: [dictVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @Operation(summary = "平台端条件查询字典类型信息接口")
    @GetMapping("getType")
    public ResponseDTO getDictTypeList(DictVO dictVO) {
        return dictService.getDictTypeList(dictVO);
    }
    /**
    * @Description: 新增字典类型
    * @Param: [dictVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("新增字段")
    @Operation(summary = "平台端新增字典类型信息接口")
    @PostMapping("addType")
    public ResponseDTO addDictType(@RequestBody DictVO dictVO){
        return dictService.addDictType(dictVO);
    }

    /**
    * @Description: 修改字典类型
    * @Param: [dictVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("修改字典类型信息")
    @Operation(summary = "平台端修改字典类型信息接口")
    @PostMapping("updateType")
    public ResponseDTO updateDictType(@RequestBody DictVO dictVO){
        return dictService.updateDictType(dictVO);
    }

    /***
    * @Description: 修改字典类型状态
    * @Param: [dictVO]
    * @return: com.cykj.common.dto.ResponseDTO
    */
    @MyLog("修改字典类型状态")
    @Operation(summary = "平台端修改字典类型状态接口")
    @PostMapping("updateTypeStatus")
    public ResponseDTO deleteDictType(@RequestBody DictVO dictVO){
        return dictService.deleteDictType(dictVO);
    }

    /**
     * @Description: 查询字典数据
     * @Param: [dictVO]
     * @return: com.cykj.common.dto.ResponseDTO
     */
    @Operation(summary = "平台端查询字典数据信息接口")
    @GetMapping("getData")
    public ResponseDTO getDictDataList(DictVO dictVO) {
        return dictService.getDictDataList(dictVO);
    }

    /**
     * @Description: 新增字典数据
     * @Param: [dictVO]
     * @return: com.cykj.common.dto.ResponseDTO
     */
    @MyLog("新增字典数据信息")
    @Operation(summary = "平台端新增字典数据信息接口")
    @PostMapping("addData")
    public ResponseDTO addDictData(@RequestBody DictVO dictVO){
        return dictService.addDictData(dictVO);
    }

    /**
     * @Description: 修改字典数据
     * @Param: [dictVO]
     * @return: com.cykj.common.dto.ResponseDTO
     */
    @MyLog("修改字典数据信息")
    @Operation(summary = "平台端修改字典数据信息接口")
    @PostMapping("updateData")
    public ResponseDTO updateDictData(@RequestBody DictVO dictVO){
        return dictService.updateDictData(dictVO);
    }

    /***
     * @Description: 修改字典数据状态
     * @Param: [dictVO]
     * @return: com.cykj.common.dto.ResponseDTO
     */
    @MyLog("修改字典数据状态")
    @Operation(summary = "平台端修改字典数据状态接口")
    @PostMapping("updateDataStatus")
    public ResponseDTO deleteDictData(@RequestBody DictVO dictVO){
        return dictService.deleteDictData(dictVO);
    }
}